import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { TDesignResolver ,AntDesignVueResolver} from "unplugin-vue-components/resolvers";

// https://vite.dev/config/
export default defineConfig({
  base: "./",
  plugins: [
    vue(),
   
    AutoImport({
      resolvers: [
        TDesignResolver({
          library: "vue-next",
        }),
      ],
    }),
    Components({
      resolvers: [
        TDesignResolver({
          library: "vue-next",
        }),
        AntDesignVueResolver({
          importStyle: false, // css in js
        }),
      ],
    }),
  ],
  server: {
    open: true,
    port: 5178,

    hmr: true,
  },
  resolve: {
    extensions: [".ts", ".js", ".less", ".css", ".vue"],
    alias: {
      "@": resolve(__dirname, "./src/"),
    },
  },
  optimizeDeps: {
    exclude: ["@wiris/mathtype-html-integration-devkit"],
  },
  assetsInclude: [
    '**/*.png', 
    '**/*.jpg',
    '**/*.svg' // 包含 CKEditor 图标资源
  ],
});
